/**
 *
 * @authors supmain (mtingfeng@gmail.com)
 * @date    2014-08-18 08:24:07
 * @update  2014-08-18 08:24:07
 * @for webapp.html
 * @version $Id$
 */
$(function() {
	$('#slides').slides({
        preload: true,
        play: 3000,
        pause: 2500,
        hoverPause: true
    });

    $('#img_ul').bxCarousel({
        display_num: 4,
        move: 1,
        margin: 10,
        next_image: "images/next-no.gif",
        prev_image: "images/pre-no.gif"
    });
    
    showQrcode();
});

//显示下载产品二维码图片
function showQrcode() {
	$(".ewm").hover(function(){
		$(this).find('div').show();
	},function(){
		$(this).find('div').hide();
	});
	$(".ewm").hover(function(){
		$(this).find('div').show();	
	},function(){
		$(this).find('div').hide();
	});
}

/*多条件查询*/
function tcxqReload(){
	var industryId = $("#industry").val(),
	productCategoryId = $("#product_category").val(),
	productName = $("#textfield2").val();
	if(productName == '关键字') {
		productName = "";
	}
	
	var data_param = {
		mealId: $("#mealId").val(),
		industryId: industryId,
		productCategoryId: productCategoryId,
		productName: productName
	};
	$.ajax({
		type:"POST",
		url:"/mall/tcxq/search",
		data:data_param,
		async:false,
		dataType:"json",
		success:function(data){
			//套餐详情产品查询
			var mealxq = "";
			$("#mealxq").empty();
			$.each(data,function(index,p){
				if(data.length > 0) {
					mealxq +='<li>'+
				             '<div class="mod_appshow">'+
				             '<a href="/mall/gngs/'+p.productId+'" class="appmk">'+
				             '<img src="'+p.productImg+'">'+
				             '</a><a href="/mall/gngs/'+p.productId+'" class="app_name">'+p.productName+'</a>'+
				            '</div>'+
				            '</li>';
				}
			})
			$("#mealxq").append(mealxq);
			
		}
	})
	return false;
}



